package vfs.dao;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.PrimaryKeyJoinColumns;
import javax.persistence.Table;




@Entity
@Table(name="VFSPATH", schema="PUBLIC")
public class VFSPath {


    @Id
    private PathKey id;


    protected int length;


    public VFSPath() { }

    public PathKey getId() { return id; }

    public void setId(PathKey id) {
        this.id = id;
    }


    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    @ManyToOne
    @PrimaryKeyJoinColumns({
        @PrimaryKeyJoinColumn(name="ancestor", referencedColumnName="ancestor"),
        @PrimaryKeyJoinColumn(name="descendant", referencedColumnName="descendant")
    })
    private VFSNode ancestor; /* pointing back to ancestor */
}
